home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 17 / AMIGAplus Sonderheft 17 (1999)(ICP)(DE)[!].iso / Rexx / Visage_Slideshow.dopus5 < prev    next >
Text File  |  1998-06-21  |  4KB  |  109 lines

  1. /* Visage_Slideshow for Directory Opus 5 and Visage.
  2.  By Leo 'Nudel' Davidson for Gods'Gift Utilities
  3.  email: leo.davidson@keble.oxford.ac.uk  www: http://info.ox.ac.uk/~kebl0364/
  4.  
  5.  Visage is (C)1995 by Magnus Holmgren (Internet: cmh@lls.se or cmh@augs.se,
  6.  Fidonet: 2:204/204.6) and available on Aminet or from Magnus' WWW Page
  7.  (http://www.lls.se/~cmh). Many thanks to Magnus for a great picture viewer,
  8.  especially the rare random-slideshow and xpk-decrypt options.
  9.  
  10. $VER: Visage_Slideshow.dopus5 1.5 (8.1.96)
  11.  
  12.    NOTE: This script _requires_ DOpus v5.11 or above.
  13.  
  14.    This simple script will call "Visage" to display a slideshow of all
  15.    pictures in the source-lister's path, in random order. Optionally, a
  16.    requester will appear so that you can give it a password to xpk-decrypt the
  17.    pictures with, if required.
  18.  
  19.    To change the default amount of time pictures are displayed for, alter the
  20.    "Visage_Delay" variable below (time in seconds).
  21.  
  22.    This script has the ability to disable SwazBlanker for the duration of
  23.    the slideshow. For this to work you must have a program called "handlecx"
  24.    in your path and you must enable it by having the "DisSwaz" switch below
  25.    as "YES". If you don't run SwazBlanker or don't have handlecx, make sure
  26.    you set it to "NO" or things might not work.
  27.  
  28. Call as:
  29. ------------------------------------------------------------------------------
  30. ARexx    DOpus5:ARexx/Visage_Slideshow.dopus5 {Qp} {s} [NoPass] [<Time>]
  31. ------------------------------------------------------------------------------
  32. Turn off all switches.
  33. "[]" means this part is optional.
  34. Arguments must be given in the order shown.
  35.  
  36. NoPass: Tells the script not to prompt for a password (no decryption).
  37. <Time>: Override the default delay-time (seconds) between pictures.
  38.  
  39.    v1.00 -> v1.01 - Very minor tidying up.
  40.                     Now checks to make sure the DOPUS.x port exists.
  41.     v1.01 -> v1.2 - Now uses Show() instead of ShowList(). (Thanks Stoebi)
  42.                     Style Guide compliant version numbering and $VER string.
  43.      v1.2 -> v1.3 - "NoPass" option added to surpress password prompt.
  44.                     Added the ability to change the default delay time on
  45.                     the command line.
  46.      v1.3 -> v1.4 - Paths with a space at the beginning or end will now be
  47.                     handled correctly, for what it's worth.
  48.      v1.4 -> v1.5 - Now has the ability to disable SwazBlanker for the
  49.                     duration of the slideshow. See above for details.
  50. */
  51. /*- Path to Visage command -------------------------------------------------*/
  52. Visage_Path  = "DH0:Tools/Art/Utils/Visage"
  53. /*- Default Delay variable -------------------------------------------------*/
  54. Visage_Delay = 5
  55. /*- If you run SwazBlanker and have "handlecx" in your path, put "YES" -----*/
  56. DisSwaz = "YES"
  57. /*--------------------------------------------------------------------------*/
  58. options results
  59. options failat 99
  60. signal on syntax;signal on ioerr        /* Error trapping */
  61. parse arg DOpusPort source_path.0 opt1 opt2 .
  62. DOpusPort = Strip(DOpusPort,"B",'" ')
  63. /* Important: source_path.0 must be stripped as below incase there is a
  64.               space at the beginning or end of the name */
  65. source_path.0 = Strip(Strip(source_path.0,"B",' '),"B",'"')
  66.  
  67. If DOpusPort="" THEN Do
  68.     Say "Not correctly called from Directory Opus 5!"
  69.     Say "Load this ARexx script into an editor for more info."
  70.     EXIT
  71.     END
  72. If ~Show("P",DOpusPort) Then Do
  73.     Say DOpusPort "is not a valid port."
  74.     EXIT
  75.     End
  76. Address value DOpusPort
  77.  
  78. If DisSwaz = "YES" Then
  79.     Address command 'handlecx disable "SwazBlanker"'
  80.  
  81. Delay = Visage_Delay
  82. AskPass = "Y"
  83. If opt1~="" then do
  84.     If upper(opt1)="NOPASS" then do
  85.         AskPass = "N"
  86.         opt1 = opt2
  87.         End
  88.     If Datatype(opt1,"N") then
  89.         Delay = opt1
  90.     End
  91.  
  92. Visage_Password = ""
  93. If AskPass = "Y" then do
  94.     dopus getstring '"Enter password, if required" 256 "" Okay|Cancel'
  95.  
  96.     If DOPUSRC = 0 Then
  97.         Exit
  98.     Else
  99.         If Result ~= "RESULT" Then
  100.             Visage_Password = ' PASSWORD "' || RESULT || '"'
  101.     End
  102.  
  103. address command Visage_Path source_path.0 || "#? DELAY" Delay Visage_Password "NOBUSY FOREVER QUIET RANDOM WAITFORPIC CENTRE"
  104.  
  105. syntax:;ioerr:                /* In case of error, jump here */
  106. If DisSwaz = "YES" Then
  107.     Address command 'handlecx enable "SwazBlanker"'
  108. EXIT
  109.